﻿using com.guojin.core.io;
using com.guojin.core.io.message;

namespace com.guojin.mj.net.message.game
{
    public class BetInfoReq : Message
    {
        public static int TYPE = 12;
        public static int ID = 12;

        public int betType { get; set; } // 1下注 2跟注 3弃牌
        public int locationIndex { get; set; } // 提交信息的玩家
        public int betOrCallScore { get; set; } // betType1代表玩家下注金额,betType2代表玩家跟注金额,betType3发送0。

        public void decode(Input _in)
        {
        }

        public void encode(Output _out)
        {
            _out.writeInt(betType);
            _out.writeInt(locationIndex);
            _out.writeInt(betOrCallScore);
        }

        public int getMessageId()
        {
            return ID;
        }

        public int getMessageType()
        {
            return TYPE;
        }

        public string toString()
        {
            return string.Format("BetInfoReq[betType={0}, UserID={1}, betOrCallScore={2}]", betType,
                locationIndex, betOrCallScore);
        }

        public static BetInfoReq Creat(int betType, int locationIndex, int betOrCallScore)
        {
            var bi = new BetInfoReq();
            bi.betType = betType;
            bi.locationIndex = locationIndex;
            bi.betOrCallScore = betOrCallScore;
            return bi;
        }
    }
}